package LeetCode.month04.day114;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 16778
 * @date 2025/11/24 8:16
 * @description
 */
public class No1018 {
    public List<Boolean> prefixesDivBy5(int[] nums) {
        int n = nums.length;
        long sum = 0;
        List<Boolean> res = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            sum = (sum * 2 + nums[i])%5;
            res.add(sum == 0);
        }
        return res;
    }
}
